/*
============================================================================
 Name        : FlashUtil3rdTelephony.h
 Author      : ceze
 Version     :
 Copyright   : joyhoo
 Description : CFlashUtil3rdTelephony declaration
============================================================================
*/

#ifndef __FLASHUTIL3RDTELEPHONY_H__
#define __FLASHUTIL3RDTELEPHONY_H__

#include <e32base.h>	// For CActive, link against: euser.lib
#include <etel3rdparty.h> //For Telephony
//#include <cpbkcontactengine.h>//For CPbkContactEngine Link against: PbkEng.lib

#include "TelephonyNotify.h"

//class MTelephonyNotify;
class CTelephony;

class CFlashUtil3rdTelephony : public CActive
{
public:
		
	static CFlashUtil3rdTelephony* NewL(MTelephonyNotify &aNotify);
	// Cancel and destroy
	~CFlashUtil3rdTelephony();

public: // New functions
	// Function for making the initial request
	void RegisterVoiceLineStatusChange();
	void UnRegister();

private: // From CActive
	
	// C++ constructor
	CFlashUtil3rdTelephony(MTelephonyNotify &aNotify);	
	// Second-phase constructor
	void ConstructL();


	// Override to handle leaves from RunL(). Default implementation causes
	// the active scheduler to panic.
	//void RunError(TInt aError);
	// Handle completion
	void RunL();
	
	// How to cancel me
	void DoCancel();
	
private:
	//Reference to a class implementing MTelephonyNotify
	MTelephonyNotify& iNotify;
	//A reference to a CTelephony
	CTelephony * ipTel;

	/*
       When the voice line status changes (and hence the asynchronous
       operation completes) the new voice line status is written into
       iLineStatus. Until this point, iLineStatus is not valid.
	*/
	CTelephony::TCallStatusV1 iLineStatus;
    CTelephony::TCallStatusV1Pckg iLineStatusPckg;
    
    //Use for save call in phone number!
    //CPbkContactEngine* m_pPbkContactEngine;

};

#endif
